<template>
	<view>
		<view class="text_content">
			<u-parse :html="showTextContent"></u-parse>
		</view>
	</view>
</template>

<script>
	import http from '@/utils/http'
	import api from '@/api'
	export default {
		data() {
			return {
				showTextContent: ''
			};
		},
		onLoad(options) {
			this.getData(options.alias)
		},
		methods: {
			getData(alias) {
				uni.setNavigationBarTitle({
					title: alias == 'agreement' ? '注册协议' : '隐私政策'
				})
				http
					.get(api.agreement)
					.then(res => {
						if (parseInt(res.data.code) === 200) {
							this.showTextContent =
								alias == 'agreement' ? res.data.data.agreement : res.data.data.privacy
						}
					})
					.catch(() => {})
			}
		},
	}
</script>

<style lang="scss" scoped>
.text_content {
	font-size: 28rpx; 
	padding: 40rpx;
}
</style>
